<template>
  <div>
    <v-breadcrumbs :items="items"></v-breadcrumbs>
  </div>
</template>

<script>
export default {
  data() {
    return {
      items: [],
    }
  },

  watch: {
    $route: {
      handler(route) {
        const menu = route.matched.map((r) => {
          return {
            text: r.name,
            to: {
              name: r.path,
            },
          }
        })
        menu.unshift({
          text: 'dashboard',
          to: {
            path: '/',
          },
        })
        this.items = menu
      },
      immediate: true,
    },
  },
}
</script>

<style scoped lang="scss"></style>
